package com.basic;

import com.frame.struts.BaseBean;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.utils.CommUtil;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;


/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class QynhForm extends BaseBean {
    public QynhForm() {
    }
private String oldId="";
	QynhEntity qynh = new QynhEntity();

public String addQynh() {
	HttpServletRequest request = ActionContext.getActionContext().
		getRequest();
	HttpServletResponse response = ActionContext.getActionContext().
		getResponse();
	BasicFactory factory = new BasicFactory();
	String qyid = (String) request.getSession().getAttribute("session_qyid");
	qynh.setQyid(qyid);
	qynh.setOptdate(new Date());
	qynh.setOptrid(CommUtil.getUserId(request));
	try{
	if (factory.addQynh(qynh)) {
        response.sendRedirect("/kehuzk/queryQynh.jsp");
	}else{
	response.sendRedirect("/basic/failed.jsp");
	}
		}
		catch (Exception e) {

		}

	return null;
}

public String modifyQynh(){
//	   System.out.println("fkajfk322");
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
//		System.out.println("22222");
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		System.out.println(qyid);
		qynh.setQyid(qyid);
		qynh.setOptdate(new Date());
		qynh.setOptrid(CommUtil.getUserId(request));
//		System.out.println("fkajfk322"+this.getOldId());
		factory.deleteQynh(qyid,this.getOldId());
		try{
			if (factory.addQynh(qynh)) {
		        response.sendRedirect("/kehuzk/queryQynh.jsp");
			}else{
			response.sendRedirect("/basic/failed.jsp");
			}
				}
				catch (Exception e) {

				}

			return null;
	}
	public String getOldId() {
		return this.oldId;
	}
	/**
	 * @param chd The chd to set.
	 */
	public void setOldId(String oldId) {
		this.oldId=oldId;
	}

/**
* @return qynh. return qynh.s the dnpjdj.
*/
public double getDnpjdj() {
return qynh.getDnpjdj();
}
/**
* @param dnpjdj The dnpjdj to set.
*/
public void setDnpjdj(double dnpjdj) {
qynh.setDnpjdj(dnpjdj);
}
/**
* @return qynh. return qynh.s the dnpjsj.
*/
public double getDnpjsj() {
return qynh.getDnpjsj();
}
/**
* @param dnpjsj The dnpjsj to set.
*/
public void setDnpjsj(double dnpjsj) {
qynh.setDnpjsj(dnpjsj);
}
/**
* @return qynh. return qynh.s the ny.
*/
public String getNy() {
return qynh.getNy();
}
/**
* @param ny The ny to set.
*/
public void setNy(String ny) {
qynh.setNy(ny);
}
/**
* @return qynh. return qynh.s the optdate.
*/
public Date getOptdate() {
return qynh.getOptdate();
}
/**
* @param optdate The optdate to set.
*/
public void setOptdate(Date optdate) {
qynh.setOptdate(optdate);
}
/**
* @return qynh. return qynh.s the optrid.
*/
public String getOptrid() {
return qynh.getOptrid();
}
/**
* @param optrid The optrid to set.
*/
public void setOptrid(String optrid) {
qynh.setOptrid(optrid);
}
/**
* @return qynh. return qynh.s the qyid.
*/
public String getQyid() {
return qynh.getQyid();
}
/**
* @param qyid The qyid to set.
*/
public void setQyid(String qyid) {
qynh.setQyid(qyid);
}
/**
* @return qynh. return qynh.s the recstate.
*/
public String getRecstate() {
return qynh.getRecstate();
}
/**
* @param recstate The recstate to set.
*/
public void setRecstate(String recstate) {
qynh.setRecstate(recstate);
}
/**
* @return qynh. return qynh.s the remark.
*/
public String getRemark() {
return qynh.getRemark();
}
/**
* @param remark The remark to set.
*/
public void setRemark(String remark) {
qynh.setRemark(remark);
}
/**
* @return qynh. return qynh.s the sdhj.
*/
public double getSdhj() {
return qynh.getSdhj();
}
/**
* @param sdhj The sdhj to set.
*/
public void setSdhj(double sdhj) {
qynh.setSdhj(sdhj);
}
/**
* @return qynh. return qynh.s the ydhj.
*/
public double getYdhj() {
return qynh.getYdhj();
}
/**
* @param ydhj The ydhj to set.
*/
public void setYdhj(double ydhj) {
qynh.setYdhj(ydhj);
}
/**
* @return qynh. return qynh.s the ydl.
*/
public double getYdl() {
return qynh.getYdl();
}
/**
* @param ydl The ydl to set.
*/
public void setYdl(double ydl) {
qynh.setYdl(ydl);
}
/**
* @return qynh. return qynh.s the yshj.
*/
public double getYshj() {
return qynh.getYshj();
}
/**
* @param yshj The yshj to set.
*/
public void setYshj(double yshj) {
qynh.setYshj(yshj);
}
/**
* @return qynh. return qynh.s the ysl.
*/
public double getYsl() {
return qynh.getYsl();
}
/**
* @param ysl The ysl to set.
*/
public void setYsl(double ysl) {
qynh.setYsl(ysl);
}


}